/*
 * Echte Wörter in Abhängigkeit der Wortlänge:
 *   -> evaluation.log aggregieren
 */
package complet.app.tool.experiment;

import complet.helper.IOHelper;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;

public class experiment1_1 {

    private static BufferedReader elog = IOHelper.openReadFile("E:\\paul\\Dokumente\\MyDocuments\\NetBeans Workspace\\Completion\\stats\\225_250T\\Evaluation.log");
    private static int[] stat = new int[26];
    private static BufferedWriter out = IOHelper.openWriteFile("E:\\paul\\Dokumente\\MyDocuments\\NetBeans Workspace\\Completion\\stats\\225_250T\\experiment1\\org_stat.dat");

    public static void main(String[] args) {
        try {
            String strLine;
            String line[];
            String word;
            // Für WordStat1
            while (true && (strLine = elog.readLine()) != null) {
                elog.readLine();
                line = strLine.split("\t");
                word = line[1];
                if(word.length() <= 25){
                    stat[word.length()]++;
                }
            }
        } catch (IOException ex) {
            IOHelper.logError("(experiment1) Failed to read input file: " + ex.getMessage());
        }

        try {
            out.write("### Originalwörter in Abhängigkeit von Wortlänge ###\n");

            for (int i = 1; i < stat.length; i++) {
                out.write(i + "  " + stat[i] + "\n");
            }
            out.flush();
            out.close();
        } catch (IOException ex) {
            IOHelper.logError("(experiment1) Failed to write result file: " + ex.getMessage());
        }
    }
}
